3026116d25fb0d417353e277bcb5be832324840b,src/test/java/se/bjurr/prnfb/service/ButtonsServiceTest.java,ButtonsServiceTest,testThatButtonsCanBeRetrievedWhenAllAllowed,#,136

Before Change


    List<PrnfbButton> candidates = newArrayList(this.button1, this.button2, this.button3);
    when(this.settingsService.getButtons()) //
        .thenReturn(candidates);
    when(this.userCheckService.isAllowedUseButton(this.button1)) //
        .thenReturn(true);
    when(this.userCheckService.isAllowedUseButton(this.button2)) //
        .thenReturn(true);

After Change


    List<PrnfbButton> candidates = newArrayList(this.button1, this.button2, this.button3);
    when(this.settingsService.getButtons()) //
        .thenReturn(candidates);
    String projectKey = prRef.getRepository().getProject().getKey();
    String repoSlug = prRef.getRepository().getSlug();
    when(this.userCheckService.isAllowed(this.button1.getUserLevel(), projectKey, repoSlug)) //
        .thenReturn(true);
    when(this.userCheckService.isAllowed(this.button2.getUserLevel(), projectKey, repoSlug)) //
        .thenReturn(true);